import dynamic from 'dva/dynamic';

// wrapper of dynamic
const dynamicWrapper = (app, models, component) => dynamic({
  app,
  models: () => models.map(m => import(`../models/${m}.js`)),
  component,
});


export const TrainingUnitsTrainingManagement = (app) => {
  return {
    name: '培训管理(参训单位)',
    icon: 'renshizhaopin',
    path: 'TrainingUnitsTrainingManagement',
    children: [
      {
        name: '课程列表',
        path: 'CoursesList',
        component: dynamicWrapper(app, [], () => import('../routes/Training/TrainingUnitsTrainingManagement/CoursesList')),
      },
      {
        name: '订单管理',
        path: 'OrderManagement',
        component: dynamicWrapper(app, [], () => import('../routes/Training/TrainingUnitsTrainingManagement/OrderManagement')),
      },
      {
        name: '学员管理',
        path: 'StudentManagement',
        component: dynamicWrapper(app, [], () => import('../routes/Training/TrainingUnitsTrainingManagement/StudentManagement')),
      },
    ],
  };
};
